import request from '../utils/request';

// 拼接URL
// export function uploadCalibrationFile(data) {
//     return request({
//         baseURL: 'carmanage',
//         url: '/web/file/uploadCalibrationFile?calibrationDate=20220518&vin=33333&type=360',
//         method: 'post',
//         data
//     });
// };

export function uploadCalibrationFile(data, url) {
    return request({
        apiType:'CAR',
        baseURL: 'carmanage',
        url: "/web/file/uploadCalibrationFile?" + url,
        method: 'post',
        data
    });
};


export function getCalibrationFilesByPage (data) {
    return request({
        apiType:'CAR',
        baseURL: 'carmanage',
        url: '/web/file/getCalibrationFilesByPage',
        method: 'post',
        data
    });
};

export function downloadCalibrationFile (data) {
    return request({
        apiType:'CAR',
        baseURL: 'carmanage',
        url: '/web/file/downloadFile?identifier=' + data.identifier,
        method: 'get',
        responseType: "blob",
        // headers:{
        //     'Content-Type': 'multipart/form-data;charset=UTF-8'
        // },
    });
};


export function updateCalibrationFileCurrentUse (data) {
    return request({
        apiType:'CAR',
        baseURL: 'carmanage',
        url: '/web/file/updateCalibrationFileCurrentUse',
        method: 'post',
        data
    });
};


